Our journey of reviewing different implementations of the Look-and-Say sequence concludes today with a simple and clean submission. Dan and Ashley pair programmed to bring us this solution to remind us how clean and simple code can be.
First, you’ll notice how tight this solution is. Short, sweet, and to the point.
Second, it uses regular expressions to parse the Look-and-Say pattern. The simplicity of this solution is a reminder of the power of RegEx.
Lastly, unlike Chris’ implementation that included both RegEx and recursion, Dan and Ashley have used a while loop to iterate through the matches.
It’s simple, clean, and easy to follow.
Great work Dan and Ashley!